package com.ccc.demoboot.common;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 自定义全局异常处理类
 */
@RestControllerAdvice
public class MyGlobalExceptionHandler {

    @ExceptionHandler(Exception.class)
    public R myExceiptionHandler() {
        return new R().setCode(501).setMessage("出错了");
    }

}
